How to let the function return a value:

function myFunction()
   {return ("Hello, have a nice day!")}

document.write(myFunction())